Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 5 - Ink Objects / Using Ink Objects


Getting and Setting an Ink Object's Transfer Mode

You can use the GXGetInkTransfer function to retrieve the transfer mode
(as a gxTransferMode structure) of an existing ink object; you can use the GXGetShapeTransfer function to retrieve the transfer mode of the ink object associated with a particular shape. You can use the GXSetInkTransfer function
to assign a transfer mode to an ink; you can use the GXSetShapeTransfer
function to assign a transfer mode to the ink object associated with a particular shape.

To simply get the transfer mode of an existing ink (referenced here by myInk) requires defining a transfer mode structure, then calling GXGetInkTransfer to fill it:

gxTransferMode myInkTransfer;
GXGetInkTransfer(myInk, &myInkTransfer);
If you want to obtain some part of the ink's transfer mode structure, such as its color space, you could make calls like this:

gxTransferMode myInkTransfer;
gxColorSpace myTransferSpace;
myTransferSpace = GXGetInkTransfer(myInk, &myInkTransfer)->space;
Conversely, to set some portion of an ink's transfer mode structure, such as one of its transfer component structures (in an array here called newComponents), you could make these calls:

gxTransferMode myInkTransfer;
GXGetInkTransfer(myInk, &myInkTransfer);
myInkTransfer.component[2] = newComponents[2];
GXSetInkTransfer(myInk, &myInkTransfer);
You can alter a shape's transfer mode type by setting the component mode for one component of its ink's transfer mode. For example, you can change the transfer mode type of the first color component of the shape myShape to gxMinimumMode with calls like this:

gxTransferMode myShapeTransfer;
GXGetShapeTransfer(myShape &myShapeTransfer);
myShapeTransfer.component[0].mode = gxMinimumMode;
GXSetShapeTransfer(myShape, &myShapeTransfer);
The GXGetInkTransfer function is described on page 5-72; the GXGetShapeTransfer function is described on page 5-74. The GXSetInkTransfer function is described on page 5-73; the GXSetShapeTransfer function is described on page 5-75.

Transfer modes and the transfer mode structure are described in the section
"About Transfer Modes" beginning on page 5-11. The next section describes how to
use transfer modes to get particular drawing effects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996